package cn.mccraft.uide.core.ui.control;

import cn.mccraft.uide.core.ui.control.skin.StatusBarItemSkin;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.Node;
import javafx.scene.control.Control;
import javafx.scene.control.Skin;

public class StatusBarItem extends Control {
	
	private ObjectProperty<StatusBarAlignment> statusBarAlignment;
	public final ObjectProperty<StatusBarAlignment> statusBarAlignmentProperty() {
		if(statusBarAlignment == null) 
			statusBarAlignment = new SimpleObjectProperty<>();
		return statusBarAlignment;
	}
	public final StatusBarAlignment getStatusBarAlignment() {
		return statusBarAlignment == null ? StatusBarAlignment.LEFT : statusBarAlignment.get();
	}
	public final void setStatusBarAlignment(StatusBarAlignment value) {
		statusBarAlignmentProperty().set(value);
	}
	
	private ObjectProperty<Node> content;
	public final ObjectProperty<Node> contentProperty(){
		if(content == null)
			content = new SimpleObjectProperty<>();
		return content;
	}
	public final Node getContent() {
		return content == null ? null : content.get();
	}
	public final void setContent(Node value) {
		contentProperty().set(value);
	}
	
	public StatusBarItem() {
		getStyleClass().setAll("status-bar-item");
	}
	
	@Override
	protected Skin<?> createDefaultSkin() {
		return new StatusBarItemSkin(this);
	}

}
